<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	>

	<ui:param name="pvb" value="#{commonContentViewBean.parent}" />
	<ui:param name="pageViewBean" value="#{commonContentViewBean}" />
	<ui:param name="compId" value="#{pageViewBean.id}" />
	<ui:param name="compTitle" value="编辑角色" />

	<h:form id="#{compId}_form">
		<p:fieldset id="#{compId}_fieldset" legend="#{compTitle}"
			toggleable="true" toggleSpeed="500"
			style="text-align: center;">
			<ui:decorate template="/layout/input/editable-template.xhtml">
			    <ui:param name="compColumnNum" value="2" />
			    <ui:param name="compLabelStyle" value="width:15%;"/>
			    <ui:param name="compContentStyle" value="width:35%;"/>
			    
				<!-- 第一行 -->
				<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
					<ui:param name="compBean1Id" value="roleNumber" />
					<ui:param name="compBean2Id" value="roleName" />
					<ui:param name="compBean1Lable" value="角色编号：" />
					<ui:param name="compBean2Lable" value="角色名称：" />
					<ui:param name="compBean1Required" value="true" />
					<ui:param name="compBean2Required" value="true" />
					
					<ui:define name="compBean1Content">
						<h:inputText id="roleNumber" value="#{pageViewBean.roleNumber}" styleClass="{required:true}"/>
					</ui:define>
					<ui:define name="compBean2Content">
						<h:inputText id="roleName" value="#{pageViewBean.roleName}" styleClass="{required:true}"/>
					</ui:define>
					
				</ui:decorate>
				
				<!-- 第二行 -->
				<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
					<ui:param name="compBean1Id" value="roleLevel" />
					<ui:param name="compBean1Lable" value="角色级别：" />
					<ui:param name="compBean2Id" value="roleDesc" />
					<ui:param name="compBean2Lable" value="角色描述：" />
					
					<ui:define name="compBean1Content"> 
						<h:selectOneMenu value="#{pageViewBean.roleLevel}" style=" width:128;">  
	            			<f:selectItem itemLabel="省级" itemValue="0" />  
	            			<f:selectItem itemLabel="市级" itemValue="1" />  
	           				<f:selectItem itemLabel="县级" itemValue="2" />  
	       				</h:selectOneMenu>
					</ui:define>
					<ui:define name="compBean2Content"> 
						<h:inputText id="roleDesc" value="#{pageViewBean.roleDesc}" />
					</ui:define>
					
				</ui:decorate>
				
			</ui:decorate>
		</p:fieldset>
		
		<p:separator />
			
		<center>
			<h:panelGrid id="#{compId}_control" columns="4" style="text-align:center;" cellspacing="2px">
				<p:commandButton
					actionListener="#{roleManagerAction.update}" title="保存"
					onstart="return SinoPortal.Validation.validateForm('#{compId}_form')"
					oncomplete="#{commonContentViewBean.id}_dialog.hide();"
					image="./img/icons/add.png" value="保存" style="margin:5px;"
					update="#{pvb.id}_roleForm">
					<h:inputHidden value="#{pageViewBean.id}" />
				</p:commandButton>
				
				<p:commandButton title="关闭" type="button"
					onclick="#{commonContentViewBean.id}_dialog.hide();"
					image="./img/icons/cancel.png" value="关闭" style="margin:5px;">
				</p:commandButton>
			</h:panelGrid>
		</center>
	
		<p:panel header="权限设置" style="width:99%;height:72%;overflow:auto;">
			<p:treeTable id="#{pageViewBean.id}_tree"
					value="#{pageViewBean.root}" selectionMode="checkbox"
					selectionColumnLabel="选择"
					selection="#{pageViewBean.selectedMenus}" var="menuNavi"
					expanded="true">
					<p:column>
						<f:facet name="header">
							功能导航
						</f:facet>
						<h:outputText value="#{menuNavi.name}" />
					</p:column>
				</p:treeTable>
		</p:panel>
		
	</h:form>

</ui:composition>